<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User;
use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles;
use Tymon\JWTAuth\Contracts\JWTSubject;

class AdminUser extends User implements JWTSubject
{
    use Notifiable, HasRoles;

    protected $guard_name = 'admin';

    protected $fillable = [
        'nickname', 'username', 'password', 'mobile', 'avatar'
    ];

    protected $hidden = [
        'password'
    ];

    /**
     * @inheritDoc
     */
    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    /**
     * @inheritDoc
     */
    public function getJWTCustomClaims()
    {
        return ['role' => 'admin'];
    }
}
